package com.yizhuoyan.his.ao;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 要录入用户的信息
 */
@Data
public class UserAddAo {
    /**
     * 帐号（登录名）
     */
    @NotBlank(message = "帐号不能为空")
    @Length(min = 5,max = 16,message = "帐号长度必须在{min}-{max}之间")
    @Pattern(regexp = "[\\w]+",message = "帐号只能是数字字母")
    private String account;
    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Length(min = 5,max = 16,message = "密码长度必须在{min}-{max}之间")
    @Pattern(regexp = "[\\w]+",message = "密码只能是数字字母")
    private String password;
    /**
     * 帐号昵称
     */
    @NotBlank(message = "帐号昵称不能为空")
    @Length(min = 2,max = 16,message = "名字长度必须在{min}-{max}之间")
    @Pattern(regexp = "[\u4e00-\u9fa5\\w]+",message = "名字只能是中文")
    private String nickname;
    /**
     * 角色Id
     */
    @NotBlank(message = "角色Id不能为空")
    private Long roleId;
}
